package cn.com.yusys.yusp.mobile.service;

import cn.com.yusys.yusp.commons.mapper.QueryModel;
import cn.com.yusys.yusp.mobile.repository.mapper.HomePageTaskMapper;
import com.github.pagehelper.PageHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author
 * @since 2021-06-24 10:24:09
 */
@Service
public class HomePageTaskService {

    @Resource
    private HomePageTaskMapper homePageTaskMapper;


    public List<Map<String, Object>> getTaskOverview(QueryModel queryModel){
        List<Map<String, Object>> list = null;
        list = homePageTaskMapper.getTaskOverview(queryModel);
        return list;
    }

    public Map<String, Object> getTaskDetailsNum(QueryModel queryModel){
        Map<String, Object> map = homePageTaskMapper.getTaskDetailsNum(queryModel);
        return map;
    }

    public List<Map<String, Object>> getTaskInformation(QueryModel queryModel){
        List<Map<String, Object>> list = homePageTaskMapper.getTaskInformation(queryModel);
        return list;
    }

    public List<Map<String, Object>> getTaskDetails(QueryModel queryModel){
        PageHelper.startPage(queryModel.getPage(), queryModel.getSize());
        List<Map<String, Object>> map = homePageTaskMapper.getTaskDetails(queryModel);
        PageHelper.clearPage();
        return map;
    }

    @Transactional
    public Integer updateTaskRemind(Map map) {
        homePageTaskMapper.updateTaskRemindNum(map);
        return  homePageTaskMapper.updateTaskRemind(map);
    }

    @Transactional
    public Integer updateImportantCustomer(Map map) {
        return  homePageTaskMapper.updateImportantCustomer(map);
    }

}